﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Wfxin.SystemFramework
{
    /// <summary>
    /// 分页模型
    /// </summary> 
    public class PagerModel
    {

        /// <summary>
		/// ctor
		/// </summary>
		public PagerModel() : this(1, 20) { }
        /// <summary>
        /// ctor
        /// </summary>
        /// <param name="currentPage">当前页</param>
        public PagerModel(int currentPage) : this(currentPage, 20) { }

        /// <summary>
        /// ctor
        /// </summary>
        /// <param name="currentPage">当前页</param>
        /// <param name="pageSize">页大小</param>
        public PagerModel(int currentPage, int pageSize)
        {
            this.CurrentPage = currentPage < 1 ? 1 : currentPage;
            this.PageSize = pageSize < 1 ? 20 : pageSize;
        }


        /// <summary>
        /// 起始时间[默认空]
        /// </summary> 
        public string BeginDate { get; set; }

        /// <summary>
        /// 结束时间[默认空]
        /// </summary> 
        public string EndDate { get; set; }

        /// <summary>
        /// 当前页码
        /// </summary>
        public int CurrPage = 1;
        /// <summary>
        /// 当前页[default(1)]
        /// </summary> 
        public int CurrentPage
        {
            get { if (CurrPage < 1) return 1; return CurrPage; }
            set { CurrPage = value; }
        }

        private int pageSize = 20;
        /// <summary>
        /// 页大小[PageSize = 20]
        /// </summary> 
        public int PageSize
        {
            get { if (pageSize < 0) return 20; return pageSize; }
            set { pageSize = value; }
        }
    }


}
